home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / 92052tar.gz / 920528.tar / internet.h < prev    next >
C/C++ Source or Header  |  1992-05-14  |  2KB  |  70 lines

  1. /* @(#) $Header: internet.h,v 1.6 92/05/14 13:20:07 deyke Exp $ */
  2.  
  3. #ifndef _INTERNET_H
  4. #define _INTERNET_H
  5.  
  6. #ifndef _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. /* Global structures and constants pertaining to the interface between IP and
  11.  *      higher level protocols
  12.  */
  13.  
  14. /* IP protocol field values */
  15. #define ICMP_PTCL       1       /* Internet Control Message Protocol */
  16. #define TCP_PTCL        6       /* Transmission Control Protocol */
  17. #define UDP_PTCL        17      /* User Datagram Protocol */
  18. #define AX25_PTCL       93      /* AX.25 inside IP according to RFC-1226 */
  19. #define IP_PTCL         94      /* IP inside IP */
  20.  
  21. #define MAXTTL          255     /* Maximum possible IP time-to-live value */
  22.  
  23. /* DoD-style precedences */
  24. #define IP_PRECEDENCE   0xe0    /* Mask for precedence field */
  25. #define ROUTINE         0x00
  26. #define PRIORITY        0x20
  27. #define IMMEDIATE       0x40
  28. #define FLASH           0x60
  29. #define FLASH_OVER      0x80
  30. #define CRITIC          0xa0
  31. #define INET_CTL        0xc0
  32. #define NET_CTL         0xe0
  33.  
  34. /* Amateur-style precedences */
  35. #define AM_ROUTINE      0x00
  36. #define AM_WELFARE      0x20
  37. #define AM_PRIORITY     0x40
  38. #define AM_EMERGENCY    0x60
  39.  
  40. /* Class-of-service bits */
  41. #define IP_COS          0x1c    /* Mask for class-of-service bits */
  42. #define LOW_DELAY       0x10
  43. #define THROUGHPUT      0x08
  44. #define RELIABILITY     0x04
  45.  
  46. /* IP TOS fields */
  47. #define PREC(x)         (((x)>>5) & 0x7)
  48. #define DELAY           0x10
  49. #define THRUPUT         0x8
  50. #define RELIABLITY      0x4
  51.  
  52. /* Pseudo-header for TCP and UDP checksumming */
  53. struct pseudo_header {
  54.     int32 source;           /* IP source */
  55.     int32 dest;             /* IP destination */
  56.     char protocol;          /* Protocol */
  57.     int16 length;           /* Data field length */
  58. };
  59. #define NULLHEADER      (struct pseudo_header *)0
  60.  
  61. /* Format of a MIB entry for statistics gathering */
  62. struct mib_entry {
  63.     char *name;
  64.     struct {
  65.         int32 integer;
  66.     } value;
  67. };
  68.  
  69. #endif  /* _INTERNET_H */
  70.